package com.leesche.netdoll.communication.processor;

import com.leesche.framework.core.concurrent.parallel.AbstractBufferedExecutableProcessor;
import com.leesche.framework.core.concurrent.parallel.Event;
import com.leesche.netdoll.communication.event.MessageEvent;

public abstract class AbstractNetDollExecutableProcessor extends AbstractBufferedExecutableProcessor {

	@Override
	public int selectBucket(Event event) {

		MessageEvent e = (MessageEvent) event;

		String deviceId = e.deviceId();

		int bucket = Math.abs(deviceId.hashCode()) % threadSize;

		return bucket;
	}

}
